package Red;

import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.HashMap;

public abstract class RedPacketFrame extends JFrame {

    private static final long serialVersionUID = 1L;

    private static final String DIR = "day05\\pic";

    private ArrayList<Integer> moneyList = null;

    private static int intMoney = 0;
    private static int totalMoney = 0;
    private static int count = 0;

    private static HashMap<JPanel, JLabel> panelLable = new HashMap<>();

    private static Font fontYaHei = new Font("微软雅黑",Font.BOLD, 20);
    private static Font msgFont = new Font("微软雅黑",Font.BOLD, 20);
    private static Font totalShowFont = new Font("微软雅黑",Font.BOLD, 40);
    private static Font nameFont = new Font("微软雅黑",Font.BOLD, 40);
    private static Font showNameFont = new Font("微软雅黑",Font.BOLD, 20);
    private static Font showMoneyFont = new Font("微软雅黑",Font.BOLD, 50);
    private static Font showResultFont = new Font("微软雅黑",Font.BOLD, 15);

    private static final int FRAME_WIDTH = 416;
    private static final int FRAME_HEIGHT = 650;
    private static JLayeredPane layeredPane = null;

    private static JPanel inputPanel = new JPanel();

    private static JTextField input_total = new JTextField();
    private static JTextField input_count = new JTextField();
    private static JTextField input_people = new JTextField("30");
    private static JTextField input_msg = new JTextField("恭喜发财，大吉大利");
    private static JTextField input_total_show = new JTextField("$" + input_total.getText().trim());
    private static JLabel input_intMoney = new JLabel();
    private static JLabel input_bg_label = new JLabel(new ImageIcon(DIR + "\\01_input.jpg"));

    static{
        input_total.setBounds(200, 90, 150, 50);
        input_count.setBounds(200, 215, 150, 50);
        input_people.setBounds(90, 275, 25, 30);
        input_msg.setBounds(180, 340, 200, 50);
        input_total_show.setBounds(130, 430, 200, 80);
        input_intMoney.setBounds(10, 535, 380, 65);
        input_bg_label.setBounds(0, 0, 400, 600);

        input_total.setFont(fontYaHei);
        input_count.setFont(fontYaHei);
        input_people.setFont(fontYaHei);
        input_msg.setFont(msgFont);
        input_msg.setForeground(new Color(255, 233, 38));
        input_total_show.setFont(totalShowFont);
        input_intMoney.setFont(fontYaHei);

        input_people.setOpaque(false);
        input_total_show.setOpaque(false);

        input_people.setEditable(false);
        input_total_show.setEditable(false);

        input_total.setBorder(null);
        input_count.setBorder(null);
        input_people.setBorder(null);
        input_msg.setBorder(null);
        input_total_show.setBorder(null);


    }
    private static JPanel openPanel = new JPanel();

    private static JTextField open_ownerName = new JTextField("谁谁谁");
    private static JLabel open_label = new JLabel(new ImageIcon(DIR + "\\02_open_2.gif"));
    private static JLabel open_bg_label = new JLabel(new ImageIcon(DIR + "\\02_open_1.jpg"));

    static{
        open_ownerName.setBounds(0, 110, 400, 50);
        open_bg_label.setBounds(0, 0, 400, 620);
        open_label.setBounds(102, 280, 200, 200);
        open_ownerName.setHorizontalAlignment(JTextField.CENTER);

        open_ownerName.setFont(nameFont);
        open_ownerName.setForeground(new Color(255, 200, 163));
        open_ownerName.setBackground(new Color(219, 90, 68));
        open_ownerName.setEditable(false);
        open_ownerName.setBorder(null);
    }

}
